package com.titan.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.*;

/**
 * Entity implementation class for Entity: CreditCard
 *
 */
@Entity
public class CreditCard implements Serializable {

	
	private static final long serialVersionUID = 1L;

	public CreditCard() {
		super();
	}
	
	private int id;
	private Date expiration;
	private String number;
	private String organization;
	private Customer customer;
	
	public Date getExpiration() {
		return expiration;
	}
	public void setExpiration(Date expiration) {
		this.expiration = expiration;
	}
	public String getNumber() {
		return number;
	}
	public void setNumber(String number) {
		this.number = number;
	}
	public String getOrganization() {
		return organization;
	}
	public void setOrganization(String organization) {
		this.organization = organization;
	}
	
	@OneToOne(mappedBy="creditCard")
	public Customer getCustomer() {
		return customer;
	}
	public void setCustomer(Customer customer) {
		this.customer = customer;
	}
	@TableGenerator(name="CREDIT_GENERATOR",
			table="GENERATOR_TABLE",
			pkColumnName="PRIMARY_KEY_COLUMN",
			valueColumnName="VALUE_COLUMN",
			pkColumnValue="CREDIT_ID",
			allocationSize=5)
	@Id
	@GeneratedValue(strategy=GenerationType.TABLE,generator="CREDIT_GENERATOR")
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	   
}
